// coms/tabbar/tabbar.js
Component({
  properties: {
    active: String,
  },
  methods: {
    onChange(event) {
      this.setData({ active: event.detail })
      let url = {
        home: '/pages/index/index',
        mall: '/pages/mall/mall',
        xhk: '/pages/xhk/xhk',
        my: '/pages/my/my',
      }[event.detail]
      console.log(url)
      wx.navigateTo({ url: url })
    },
  },
})
